LearningStoreQuery.AddSort Method

Add a sort order for the returned data

Parent Type: LearningStoreQuery

Namespace: Microsoft.LearningComponents.Storage

Assembly: Microsoft.LearningComponents.Storage.dll

Syntax
C#

public void AddSort (
string columnName,
LearningStoreSortDirection direction

)

Parameters

columnName

Name of the column to be sorted on. This must refer to a non-XML, non-Guid column.

direction

Direction for the sort.

Exceptions
Exception type Condition
ArgumentNullException

columnName is a null reference.

ArgumentOutOfRangeException

direction is invalid.

InvalidOperationException

The column was not found or is not sortable

Example

The following code creates a new query that returns the names of all the users in the system sorted by name:

C#
LearningStoreQuery query = store.CreateQuery("UserItemView");
query.AddColumn("Name");
query.AddSort("Name", LearningStoreSortDirection.Ascending);